<template>
	<view class="content">
		<view class="step">
			<!-- 	<uni-steps :options="[{title:'导入账号'},{title:'选择账号'},{title:'开始下单'}]" direction="column"
				:active="active"></uni-steps>
			<button type="primary" size="mini" style="margin: 30px 10px;" @click="change">导入token账号</button> -->
			<web-view @message="handleMessage" :src="'/hybrid/html/index.html?token='+token"></web-view>
		</view>
		<!-- 		<view class="token-list">
			<uni-list>
				<uni-list-item title="列表文字" v-if="item for enableToken">{{item}}</uni-list-item>
			</uni-list>
		</view> -->
	</view>
</template>

<script setup>
	import {
		useEnableToken,
		useTokenStore

	} from '@/stores'
	import {
		onMounted,
		reactive,
		ref
	}
	from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app';
	const enableToken = useEnableToken()
	const handleMessage = (e => {
		enableToken.setEnableToken(e.detail.data)
	})
	const tokenStore = useTokenStore()
	const token = ref(tokenStore.token)
	// console.log(enableToken.value);
	const change = (() => {
		uni.navigateTo({
			url: '/pages/importToken/importToken'
		})
	})
	// 获取会员信息

	onMounted(() => {
		//判断是否登录
		if (!tokenStore.token) {
			uni.navigateTo({
				url: '/pages/login/login'
			})
		}
	})
</script>

<style lang="scss">
	.content {
		// display: flex;
		// flex-direction: column;
		// align-items: center;
		// justify-content: center;
		padding: 150upx 40upx;

		// background-color: #F5F5F5;
		.step {
			// height: 200upx;
		}

		.token-list {
			margin-top: 80upx;
		}

		.upload {
			margin-top: 40upx;
		}
	}
</style>